POV-Ray : Newsgroups : povray.binaries.images : POVing again (~170k) : Re: POVing again (~170k) Server Time
11 Aug 2024 15:16:48 EDT (-0400)
  Re: POVing again (~170k)  
From: Tek
Date: 29 Feb 2004 04:31:06
Message: <4041b15a$1@news.povray.org>
"Sun Tzu" <sun### [at] nospamhotmailcom> wrote in message
news:40418673$1@news.povray.org...
> I'd appreciate any specific ideas you might
> have for improving it.

WARNING - this is an incredibly long reply! But it sounded like you wanted some
tips on texturing so I've done my best:

Okay, well one thing stands out to me straight away: that's a very complicated
material, which is rather strange since we both agree it doesn't look so good.
My advice would always be keep the material very simple until you have nearly
the effect you like.

So, following that I'd suggest this much simpler version might be a good
starting point:
 texture {
  pigment {
   wood
   ramp_wave
   color_map
   {
    [0 rgb <0.6, 0.35, 0.2> ]
    [1 rgb <0.9, 0.65, 0.3> ]
   }
   turbulence 0.05
  }
  finish {
   diffuse .7
   ambient .3
  }
  rotate <30,30,0>
  scale 0.75
 }

Now, from this we can start looking at some more complex effects, firstly we can
change the colour map so it returns smoothly to it's starting point:
   color_map {
    [ 0.0 rgb <0.6, 0.35, 0.2> ]
    [ 0.8 rgb <0.9, 0.65, 0.3> ]
    [ 1.0 rgb <0.6, 0.35, 0.2> ]
   }
Note that the colour at 1 is now the same as the colour at 0. This will remove
the hard transition that occured before.

Now, before we add anything else I think we should decide whether the colours
look right. Personally I think they look far too dark for a chopping board, so
I'd try something a bit lighter and yellower:
    [ 0.0 rgb <0.9, 0.68, 0.4> ]
    [ 0.8 rgb <1, 0.8, 0.5> ]
    [ 1.0 rgb <0.9, 0.68, 0.4> ]

That's still not perfect so I recommend you spend a bit longer at this stage
until you get some colours you like.

Now, let's alter the pattern of the stripes. That 0.8 value in the colour map
can be changed to alter the way that the colours vary across the surface, also
the ramp_wave can be changed for one of pov's other types to create different
effects. Here's one example that I like but there's many other possibilities:

 pigment {
   wood
   poly_wave 2
   color_map
   {
    [ 0 rgb <0.9, 0.68, 0.4> ]
    [ .05 rgb <1, 0.8, 0.5> ]
    [ 1 rgb <0.9, 0.68, 0.4> ]
   }
   turbulence 0.05
 }

Now, lets look at the finish. The wood you had originally had a lot of
reflection and phong highlights, this suggests a varnished wood, but of course
chopping boards aren't varnished. So let's instead try to get a smooth but not
polished sheen to it. No reflections, since chopping boards aren't really
reflective, a soft and subtle highlight, and we'll tweak the brightness of the
material.

  finish {
   diffuse .5
   ambient .3
   brilliance 1.8
   specular .2 roughness .5 metallic 1
  }

There's 2 important things to notice here: the brilliance value alters the way
that the diffuse lighting looks, larger values give a more gradual falloff. And
the metallic specular highlight with a high roughness value behaves sort of like
a half-specular/half-diffuse light. It's a trick I used to create metallic
paint, but in this situation it's trying to fake the sheen that unvarnished wood
has.

Now, there's one final thing I'd like to do to this material, it's looking a bit
flat so let's give it a normal map:

  normal {
   wood
   poly_wave 2
   turbulence 0.05
   normal_map
   {
    [ 0 granite .05 scale .4 ]
    [ .05 radial .01 rotate x*90 sine_wave frequency 200 ]
    [ 1 granite .05 scale .4 ]
   }
  }

What I've done here is use the exact same basic pattern as the pigment, but
instead of blending 2 different colours I'm blending 2 normal patterns. There's
a radial one rotated to give perpendicular stripes across the rings in the wood,
and a granite texture to add noise to the darker patches of wood.

Finally, we can tidy this up so that we don't have to have 2 copies of this
pattern, like so:

 texture {
  pigment_pattern {
   //first let's take care of the wood pattern.
   wood
   poly_wave 2
   color_map
   {
    [ 0 rgb 0 ]
    [ .05 rgb 1 ]
    [ 1 rgb 0 ]
   }
   turbulence 0.05
  }

  //we have now defined a pattern so that
  //anything we map to 0 appears on the "dark" rings
  //and anything we map to zero appears on the light rings

  texture_map {
   [0
    //pattern for dark rings, a dark colour and noisy normal
    pigment { rgb <0.9, 0.68, 0.4> }
    finish {
     diffuse .6
     ambient .3
     brilliance 1.8
     specular .1 roughness .5 metallic .5
    }
    normal { granite .05 scale .4 }
   ]
   [1
    //pattern for light rings, a lighter colour and striped normal
    pigment { rgb <1, 0.8, 0.5> }
    finish {
     diffuse .6
     ambient .3
     brilliance 1.8
     specular .1 roughness .5 metallic .5
    }
    normal { radial .01 rotate x*90 sine_wave frequency 200 }
   ]
   }

  rotate <30,30,0>
  scale .75
  scale .3
 }

This technique isn't entirely necessary, but I find using pigment_patterns like
this can make it much easier to build complex textures.

I hope all of this helps!

-- 
Tek
www.evilsuperbrain.com


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.